<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>css3Demo-img</title>
    <style>
        .demo-imgs {
            display: flex;
            width: 100%;
            border: 1px solid #ddd;
            justify-content: flex-start;
        }

        .demo-imgs>div {
            position: relative;
            text-align: center;
            color: magenta;
            height: 300px;
            transition: width 1s;
            -webkit-transition: width 1s;
            -moz-transition: width 1s;
            -o-transition: width 1s;
        }

        .mobile1 {
            width: 300px;
            background: url(../images/mobile1.jpg) no-repeat center
        }

        .mobile2 {
            width: 300px;
            background: url(../images/mobile2.jpg) no-repeat center
        }

        .mobile3,
        .mobile4,
        .mobile5 {
            width: 300px;
            background: url(../images/mobile3.jpg) no-repeat center
        }

        .mobile1:hover,
        .mobile2:hover,
        .mobile3:hover,
        .mobile4:hover,
        .mobile5:hover {
            width: 500px;
            animation: myfirst 500ms;
        }

        @keyframes myfirst {
            /* 0% {
                top: 0;
            } */
           /*  25% {
                top: -30px;
            }
            50% {
                top: -60px;
            }
            75% {
                top: -90px;
            } */
            /* 100% {
                top: -330px;
            } */
        }
    </style>
</head>

<body>
    <section class="layout">
        <div class="demo-imgs">
            <div class="mobile1">
                <h3>
                    我是第一张图片
                </h3>
            </div>
            <div class="mobile2">
                <h3>
                    我是第二张图片
                </h3>
            </div>
            <div class="mobile3">
                <h3>
                    我是第三张图片
                </h3>
            </div>
            <div class="mobile4">
                <h3>
                    我是第三张图片
                </h3>
            </div>
            <div class="mobile5">
                <h3>
                    我是第三张图片
                </h3>
            </div>
        </div>
    </section>
</body>

</html>